package com.handu.luna.core.domain.promotion;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import com.handu.luna.core.domain.BaseRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.NoRepositoryBean;

@NoRepositoryBean
public interface PromotionRepository<T extends Promotion> extends JpaRepository<T,Long>,BaseRepository<T>,JpaSpecificationExecutor<T> {

    @Query("select c from #{#entityName} c order by c.id desc")
    public Page<T> findAll(Pageable pageable);
}
